package springcloud.service;

import com.nyist.springcloud.ResultVO;
import com.nyist.springcloud.entities.Payment;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import springcloud.service.impl.FeignServiceFallback;

/**
 * @author yangxiaogen
 * @date 2021/1/31 14:31
 */
@Service
@FeignClient(value = "payment-hystrix-service",fallback = FeignServiceFallback.class)
public interface FeignService {

    @PostMapping(value = "/pay/hystrix/ok")
    ResultVO<Payment> getPaymentOk(@RequestBody Payment payment);

    @PostMapping(value = "/pay/hystrix/timeout")
    ResultVO<Payment> getPaymentTimeout(@RequestBody Payment payment);

}
